<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sj" tagdir="/WEB-INF/tags/spring-jquery-tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<script type="text/javascript">
	$(document).ready(function() {
		$('table.tablesorter').tablesorter({
			widgets : [ 'zebra' ],
			sortList : [ [ 0, 0 ] ],
			headers : {
				25 : {
					sorter : false
				}
			}
		});

		$('.edit-cipeproject-link').click(function() {
			loadDiv('content', 'showEditCipeproject.do?id=' + $(this).attr('cipeprojectId'));
		});
	});
</script>
<div id="cipeprojectListDiv" class="hastable" style="overflow: auto">
	<table class="tablesorter">
		<thead>
			<tr>
				<th><spring:message code="cipeprojectlist.table.heading.rollup" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.acronym" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.partner" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.costCenter" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.subIdentifier" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.projectID" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.projectTitle" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.nedIdentifier" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.donorAwardID" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.donorName" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.donorStartDate" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.donorEndDate" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.startDate" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.endDate" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.type" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.status" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.region" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.country" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.seniorProgramOfficer" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.programOfficer" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.programAssistant" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.managementFunds" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.riskAssessment" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.memo" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.fileLocation" /></th>
				<th><spring:message code="cipeprojectlist.table.heading.edit" /></th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${cipeprojects}" var="cipeproject">
				<tr>
					<td>${cipeproject.cipeprojectrollup.displayName}</td>
					<td>${cipeproject.acronym}</td>
					<td>${cipeproject.partner.partnerName}</td>
					<td>${cipeproject.costCenterNumber}</td>
					<td>${cipeproject.subIdentifer}</td>
					<td>${cipeproject.subIdentifer}</td>
					<td>${cipeproject.projectTitle}</td>
					<td>${cipeproject.nedIdentifier}</td>
					<td>${cipeproject.donoraward.donorAwardNumber}</td>
					<td>${cipeproject.donoraward.donor.donorName}</td>
					<td>${cipeproject.donoraward.startDate}</td>
					<td>${cipeproject.donoraward.endDate}</td>
					<td>${cipeproject.projectStartDate}</td>
					<td>${cipeproject.projectEndDate}</td>
					<td>${cipeproject.cipeprojecttype.displayName}</td>
					<td>${cipeproject.cipeprojectstatus.displayName}</td>
					<td>${cipeproject.region.displayName}</td>
					<td>${cipeproject.country.displayName}</td>
					<td>${cipeproject.seniorProgramOfficer.fullName}</td>
					<td>${cipeproject.programOfficer.fullName}</td>
					<td>${cipeproject.programAssistant.fullName}</td>
					<td>${cipeproject.managementFunds}</td>
					<td>${cipeproject.riskAssessmentScore}</td>
					<td>${cipeproject.memo}</td>
					<td>${cipeproject.fileLocation}</td>
					<td><a href="javascript://" class="edit-cipeproject-link" cipeprojectId="${cipeproject.id}"><spring:message code="cipeprojectlist.table.link.edit" /></a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div id="cipeprojectListPager"></div>
</div>
